#define _CRT_SECURE_NO_WARNINGS 1

#include"Slist.h"


void TestList1()
{
	SListNode* plist;
	SListInit(&plist);
	SListPushBack(&plist, 1);
	SListPushBack(&plist, 2);
	SListPushBack(&plist, 3);
	SListPushBack(&plist, 4);
	SListPrint(plist);
	SListPushFront(&plist, 10);
	SListPushFront(&plist, 20);
	SListPushFront(&plist, 30);
	SListPrint(plist);
	/*SListPopBack(&plist);
	SListPopBack(&plist);*/
	SListPrint(plist);
	/*SListPopFront(&plist);
	SListPopFront(&plist);
	SListPopFront(&plist);
	SListPopFront(&plist);
	SListPopFront(&plist);*/
	SListPrint(plist);
	SListNode* pos = SListFind(plist, 2);
	if (pos != NULL)
	{
		SListInsertAfter(pos, 20);
		SListPrint(plist);
	}
	 pos = SListFind(plist, 2);
	if (pos != NULL)
	{
		SListEraseAfter(pos);
		SListPrint(plist);
	}
	SListDestroy(plist);
	plist = NULL;
}

int main()
{

	TestList1();
	return 0;
}
